package com.vcms.cms.entity;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * VoteRecord entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "vote_record", catalog = "vcms_0.1")
public class VoteRecord implements java.io.Serializable {

	// Fields

	private Integer voteRecordId;
	private User user;
	private VoteItem voteItem;
	private Timestamp voteTime;
	private String voteIp;
	private String voteCookie;

	// Constructors

	/** default constructor */
	public VoteRecord() {
	}

	/** full constructor */
	public VoteRecord(User user, VoteItem voteItem, Timestamp voteTime,
			String voteIp, String voteCookie) {
		this.user = user;
		this.voteItem = voteItem;
		this.voteTime = voteTime;
		this.voteIp = voteIp;
		this.voteCookie = voteCookie;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "voteRecordId", unique = true, nullable = false)
	public Integer getVoteRecordId() {
		return this.voteRecordId;
	}

	public void setVoteRecordId(Integer voteRecordId) {
		this.voteRecordId = voteRecordId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "voteItemId")
	public VoteItem getVoteItem() {
		return this.voteItem;
	}

	public void setVoteItem(VoteItem voteItem) {
		this.voteItem = voteItem;
	}

	@Column(name = "voteTime", length = 19)
	public Timestamp getVoteTime() {
		return this.voteTime;
	}

	public void setVoteTime(Timestamp voteTime) {
		this.voteTime = voteTime;
	}

	@Column(name = "voteIp", length = 100)
	public String getVoteIp() {
		return this.voteIp;
	}

	public void setVoteIp(String voteIp) {
		this.voteIp = voteIp;
	}

	@Column(name = "voteCookie", length = 50)
	public String getVoteCookie() {
		return this.voteCookie;
	}

	public void setVoteCookie(String voteCookie) {
		this.voteCookie = voteCookie;
	}

}